<template>
  <div class="list-table">
    <el-row justify="middle">
      <el-form ref="queryForm" :model="queryParams" :inline="true">
        <el-form-item :label="$t('项目名称')">
          <deal-select v-model="queryParams.id" scope="true" @change="getDealData()" />
        </el-form-item>
        <el-form-item>
          <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t("重置") }}</el-button>
        </el-form-item>
      </el-form>
      <el-table v-loading="loading" :data="financialIndicatList" style="width: 100%" border>
        <el-table-column align="center" prop="dealName" :label="$t('项目名称')" show-overflow-tooltip width="180">
          <template slot-scope="scope">
            <router-link
              target="_blank"
              :to="{path:'/deal/home/dealBaseHome',query:{id:scope.row.dealId,companyId:scope.row.companyId}}"
              class="link_a"
            >{{ scope.row.dealName }}</router-link>
          </template>
        </el-table-column>

        <el-table-column label="2019一季报" align="center">
          <el-table-column
            prop="营业收入1"
            label="营业收入"
            width="120"
            align="center"
          />
          <el-table-column
            prop="收入增长率1"
            label="收入增长率"
            width="120"
            align="center"
          />
          <el-table-column
            prop="净利润1"
            label="净利润"
            width="120"
            align="center"
          />
          <el-table-column
            prop="总资产1"
            label="总资产"
            width="120"
            align="center"
          />
          <el-table-column
            prop="净资产1"
            label="净资产"
            width="120"
            align="center"
          />
          <el-table-column
            prop="资产负债率1"
            label="资产负债率1"
            width="120"
            align="center"
          />
        </el-table-column>
        <el-table-column label="2019二季报" align="center">
          <el-table-column
            prop="营业收入2"
            label="营业收入"
            width="120"
            align="center"
          />
          <el-table-column
            prop="收入增长率2"
            label="收入增长率"
            width="120"
            align="center"
          />
          <el-table-column
            prop="净利润2"
            label="净利润"
            width="120"
            align="center"
          />
          <el-table-column
            prop="总资产2"
            label="总资产"
            width="120"
            align="center"
          />
          <el-table-column
            prop="净资产2"
            label="净资产"
            width="120"
            align="center"
          />
          <el-table-column
            prop="资产负债率2"
            label="资产负债率"
            width="120"
            align="center"
          />
        </el-table-column>
      </el-table>

    </el-row>
  </div>
</template>

<script>
import DealSelect from '@/components/Select/dealSelect'
export default {
  components: {
    DealSelect
  },
  data() {
    return {
      chartData: [],
      loadChart: false,
      loading: false,
      // 记录上一次点击事件传的参数值
      previousVal: undefined,
      // 查询参数
      queryParams: {
        id: ''
      },
      // chart容器对象
      chart: {},
      financialIndicatList: []
    }
  },
  created() {
    this.getList()
  },
  methods: {
    getList() {
      this.financialIndicatList = [
        {
          dealName: '长安汽车',
          营业收入1: '234,234,231',
          收入增长率1: '32%',
          净利润1: '456,333',
          总资产1: '560,600,500',
          净资产1: '340,567,000',
          资产负债率1: '45%',
          营业收入2: '300,300,200',
          收入增长率2: '31%',
          净利润2: '500,600',
          总资产2: '560,600,500',
          净资产2: '340,567,000',
          资产负债率2: '40%'
        },
        {
          dealName: '字节跳动',
          营业收入1: '334,234,231',
          收入增长率1: '42%',
          净利润1: '756,333',
          总资产1: '760,600,500',
          净资产1: '640,567,000',
          资产负债率1: '65%',
          营业收入2: '500,300,200',
          收入增长率2: '41%',
          净利润2: '500,600',
          总资产2: '560,600,500',
          净资产2: '340,567,000',
          资产负债率2: '40%'
        }, {
          dealName: '福特汽车',
          营业收入1: '234,234,231',
          收入增长率1: '34%',
          净利润1: '456,333',
          总资产1: '450,600,500',
          净资产1: '350,567,000',
          资产负债率1: '65%',
          营业收入2: '355,300,200',
          收入增长率2: '21%',
          净利润2: '567,600',
          总资产2: '660,600,500',
          净资产2: '340,567,000',
          资产负债率2: '40%'
        },
        {
          dealName: '盛世汇海',
          营业收入1: '334,234,231',
          收入增长率1: '42%',
          净利润1: '756,333',
          总资产1: '778,600,500',
          净资产1: '870,567,000',
          资产负债率1: '75%',
          营业收入2: '780,300,200',
          收入增长率2: '51%',
          净利润2: '500,600',
          总资产2: '560,600,500',
          净资产2: '340,567,000',
          资产负债率2: '40%'
        }

        ]

      this.loadChart = true
    },
    resetQuery() {
      this.resetForm('queryForm')
      this.queryParams.id = ''
      this.getDealData()
    }
  }
}
</script>

<style scoped>

</style>
